import 'http_config.dart';
import 'http_request.dart';
import 'package:flutter/material.dart';


class HomeRequest {
  static void requestMovieList(int start,{BuildContext context}) {
//1.构建URL
    final movieURL = "movie/top250?start=$start&count=${HomeConfig.movieCount}";
    HttpRequest.request(movieURL, params: null).then((value) {
      print(value);
    }).catchError((onError) {
      final error = onError.toString();
      Scaffold.of(context).showSnackBar(
         SnackBar(content: Text(error)),
      );
    });
  }
}

class Person {
  String name;
  String age;

  Person.formMap(Map<String,dynamic> json){
    this.name = json["name"];
    this.name = json["age"];
  }

  @override
  String toString() {
    return 'Person{name: $name, age: $age}';
  }
}